/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.Enumerator;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.hl7.v3.CS1;
import org.hl7.v3.ED;
import org.hl7.v3.II;
import org.hl7.v3.POCDMT000040Author;
import org.hl7.v3.POCDMT000040EntryRelationship;
import org.hl7.v3.POCDMT000040Informant12;
import org.hl7.v3.POCDMT000040InfrastructureRootTypeId;
import org.hl7.v3.POCDMT000040ObservationMedia;
import org.hl7.v3.POCDMT000040Participant2;
import org.hl7.v3.POCDMT000040Performer2;
import org.hl7.v3.POCDMT000040Precondition;
import org.hl7.v3.POCDMT000040Reference;
import org.hl7.v3.POCDMT000040Specimen;
import org.hl7.v3.POCDMT000040Subject;
import org.hl7.v3.V3Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>POCDMT000040 Observation Media</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getRealmCode <em>Realm Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getTypeId <em>Type Id</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getTemplateId <em>Template Id</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getId <em>Id</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getLanguageCode <em>Language Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getValue <em>Value</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getSubject <em>Subject</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getSpecimen <em>Specimen</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getPerformer <em>Performer</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getAuthor <em>Author</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getInformant <em>Informant</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getParticipant <em>Participant</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getEntryRelationship <em>Entry Relationship</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getReference <em>Reference</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getPrecondition <em>Precondition</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getClassCode <em>Class Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getID1 <em>ID1</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getMoodCode <em>Mood Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040ObservationMediaImpl#getNullFlavor <em>Null Flavor</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class POCDMT000040ObservationMediaImpl extends EObjectImpl implements POCDMT000040ObservationMedia {
	/**
	 * The cached value of the '{@link #getRealmCode() <em>Realm Code</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRealmCode()
	 * @generated
	 * @ordered
	 */
	protected EList<CS1> realmCode;

	/**
	 * The cached value of the '{@link #getTypeId() <em>Type Id</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTypeId()
	 * @generated
	 * @ordered
	 */
	protected POCDMT000040InfrastructureRootTypeId typeId;

	/**
	 * The cached value of the '{@link #getTemplateId() <em>Template Id</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTemplateId()
	 * @generated
	 * @ordered
	 */
	protected EList<II> templateId;

	/**
	 * The cached value of the '{@link #getId() <em>Id</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getId()
	 * @generated
	 * @ordered
	 */
	protected EList<II> id;

	/**
	 * The cached value of the '{@link #getLanguageCode() <em>Language Code</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguageCode()
	 * @generated
	 * @ordered
	 */
	protected CS1 languageCode;

	/**
	 * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getValue()
	 * @generated
	 * @ordered
	 */
	protected ED value;

	/**
	 * The cached value of the '{@link #getSubject() <em>Subject</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSubject()
	 * @generated
	 * @ordered
	 */
	protected POCDMT000040Subject subject;

	/**
	 * The cached value of the '{@link #getSpecimen() <em>Specimen</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSpecimen()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Specimen> specimen;

	/**
	 * The cached value of the '{@link #getPerformer() <em>Performer</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPerformer()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Performer2> performer;

	/**
	 * The cached value of the '{@link #getAuthor() <em>Author</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAuthor()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Author> author;

	/**
	 * The cached value of the '{@link #getInformant() <em>Informant</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInformant()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Informant12> informant;

	/**
	 * The cached value of the '{@link #getParticipant() <em>Participant</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getParticipant()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Participant2> participant;

	/**
	 * The cached value of the '{@link #getEntryRelationship() <em>Entry Relationship</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEntryRelationship()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040EntryRelationship> entryRelationship;

	/**
	 * The cached value of the '{@link #getReference() <em>Reference</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getReference()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Reference> reference;

	/**
	 * The cached value of the '{@link #getPrecondition() <em>Precondition</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrecondition()
	 * @generated
	 * @ordered
	 */
	protected EList<POCDMT000040Precondition> precondition;

	/**
	 * The default value of the '{@link #getClassCode() <em>Class Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClassCode()
	 * @generated
	 * @ordered
	 */
	protected static final Enumerator CLASS_CODE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getClassCode() <em>Class Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClassCode()
	 * @generated
	 * @ordered
	 */
	protected Enumerator classCode = CLASS_CODE_EDEFAULT;

	/**
	 * The default value of the '{@link #getID1() <em>ID1</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID1()
	 * @generated
	 * @ordered
	 */
	protected static final String ID1_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getID1() <em>ID1</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID1()
	 * @generated
	 * @ordered
	 */
	protected String iD1 = ID1_EDEFAULT;

	/**
	 * The default value of the '{@link #getMoodCode() <em>Mood Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoodCode()
	 * @generated
	 * @ordered
	 */
	protected static final Enumerator MOOD_CODE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getMoodCode() <em>Mood Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMoodCode()
	 * @generated
	 * @ordered
	 */
	protected Enumerator moodCode = MOOD_CODE_EDEFAULT;

	/**
	 * The default value of the '{@link #getNullFlavor() <em>Null Flavor</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNullFlavor()
	 * @generated
	 * @ordered
	 */
	protected static final Enumerator NULL_FLAVOR_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getNullFlavor() <em>Null Flavor</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNullFlavor()
	 * @generated
	 * @ordered
	 */
	protected Enumerator nullFlavor = NULL_FLAVOR_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected POCDMT000040ObservationMediaImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return V3Package.eINSTANCE.getPOCDMT000040ObservationMedia();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<CS1> getRealmCode() {
		if (realmCode == null) {
			realmCode = new EObjectContainmentEList<CS1>(CS1.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__REALM_CODE);
		}
		return realmCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public POCDMT000040InfrastructureRootTypeId getTypeId() {
		return typeId;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetTypeId(POCDMT000040InfrastructureRootTypeId newTypeId, NotificationChain msgs) {
		POCDMT000040InfrastructureRootTypeId oldTypeId = typeId;
		typeId = newTypeId;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID, oldTypeId, newTypeId);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTypeId(POCDMT000040InfrastructureRootTypeId newTypeId) {
		if (newTypeId != typeId) {
			NotificationChain msgs = null;
			if (typeId != null)
				msgs = ((InternalEObject)typeId).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID, null, msgs);
			if (newTypeId != null)
				msgs = ((InternalEObject)newTypeId).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID, null, msgs);
			msgs = basicSetTypeId(newTypeId, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID, newTypeId, newTypeId));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<II> getTemplateId() {
		if (templateId == null) {
			templateId = new EObjectContainmentEList<II>(II.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__TEMPLATE_ID);
		}
		return templateId;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<II> getId() {
		if (id == null) {
			id = new EObjectContainmentEList<II>(II.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__ID);
		}
		return id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public CS1 getLanguageCode() {
		return languageCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetLanguageCode(CS1 newLanguageCode, NotificationChain msgs) {
		CS1 oldLanguageCode = languageCode;
		languageCode = newLanguageCode;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE, oldLanguageCode, newLanguageCode);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLanguageCode(CS1 newLanguageCode) {
		if (newLanguageCode != languageCode) {
			NotificationChain msgs = null;
			if (languageCode != null)
				msgs = ((InternalEObject)languageCode).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE, null, msgs);
			if (newLanguageCode != null)
				msgs = ((InternalEObject)newLanguageCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE, null, msgs);
			msgs = basicSetLanguageCode(newLanguageCode, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE, newLanguageCode, newLanguageCode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ED getValue() {
		return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetValue(ED newValue, NotificationChain msgs) {
		ED oldValue = value;
		value = newValue;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE, oldValue, newValue);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setValue(ED newValue) {
		if (newValue != value) {
			NotificationChain msgs = null;
			if (value != null)
				msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE, null, msgs);
			if (newValue != null)
				msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE, null, msgs);
			msgs = basicSetValue(newValue, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE, newValue, newValue));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public POCDMT000040Subject getSubject() {
		return subject;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetSubject(POCDMT000040Subject newSubject, NotificationChain msgs) {
		POCDMT000040Subject oldSubject = subject;
		subject = newSubject;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT, oldSubject, newSubject);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSubject(POCDMT000040Subject newSubject) {
		if (newSubject != subject) {
			NotificationChain msgs = null;
			if (subject != null)
				msgs = ((InternalEObject)subject).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT, null, msgs);
			if (newSubject != null)
				msgs = ((InternalEObject)newSubject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT, null, msgs);
			msgs = basicSetSubject(newSubject, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT, newSubject, newSubject));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Specimen> getSpecimen() {
		if (specimen == null) {
			specimen = new EObjectContainmentEList<POCDMT000040Specimen>(POCDMT000040Specimen.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__SPECIMEN);
		}
		return specimen;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Performer2> getPerformer() {
		if (performer == null) {
			performer = new EObjectContainmentEList<POCDMT000040Performer2>(POCDMT000040Performer2.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__PERFORMER);
		}
		return performer;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Author> getAuthor() {
		if (author == null) {
			author = new EObjectContainmentEList<POCDMT000040Author>(POCDMT000040Author.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__AUTHOR);
		}
		return author;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Informant12> getInformant() {
		if (informant == null) {
			informant = new EObjectContainmentEList<POCDMT000040Informant12>(POCDMT000040Informant12.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__INFORMANT);
		}
		return informant;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Participant2> getParticipant() {
		if (participant == null) {
			participant = new EObjectContainmentEList<POCDMT000040Participant2>(POCDMT000040Participant2.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__PARTICIPANT);
		}
		return participant;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040EntryRelationship> getEntryRelationship() {
		if (entryRelationship == null) {
			entryRelationship = new EObjectContainmentEList<POCDMT000040EntryRelationship>(POCDMT000040EntryRelationship.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__ENTRY_RELATIONSHIP);
		}
		return entryRelationship;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Reference> getReference() {
		if (reference == null) {
			reference = new EObjectContainmentEList<POCDMT000040Reference>(POCDMT000040Reference.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__REFERENCE);
		}
		return reference;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<POCDMT000040Precondition> getPrecondition() {
		if (precondition == null) {
			precondition = new EObjectContainmentEList<POCDMT000040Precondition>(POCDMT000040Precondition.class, this, V3Package.POCDMT000040_OBSERVATION_MEDIA__PRECONDITION);
		}
		return precondition;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumerator getClassCode() {
		return classCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setClassCode(Enumerator newClassCode) {
		Enumerator oldClassCode = classCode;
		classCode = newClassCode;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__CLASS_CODE, oldClassCode, classCode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getID1() {
		return iD1;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setID1(String newID1) {
		String oldID1 = iD1;
		iD1 = newID1;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__ID1, oldID1, iD1));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumerator getMoodCode() {
		return moodCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMoodCode(Enumerator newMoodCode) {
		Enumerator oldMoodCode = moodCode;
		moodCode = newMoodCode;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__MOOD_CODE, oldMoodCode, moodCode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumerator getNullFlavor() {
		return nullFlavor;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNullFlavor(Enumerator newNullFlavor) {
		Enumerator oldNullFlavor = nullFlavor;
		nullFlavor = newNullFlavor;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_OBSERVATION_MEDIA__NULL_FLAVOR, oldNullFlavor, nullFlavor));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REALM_CODE:
				return ((InternalEList<?>)getRealmCode()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID:
				return basicSetTypeId(null, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TEMPLATE_ID:
				return ((InternalEList<?>)getTemplateId()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID:
				return ((InternalEList<?>)getId()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE:
				return basicSetLanguageCode(null, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE:
				return basicSetValue(null, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT:
				return basicSetSubject(null, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SPECIMEN:
				return ((InternalEList<?>)getSpecimen()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PERFORMER:
				return ((InternalEList<?>)getPerformer()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__AUTHOR:
				return ((InternalEList<?>)getAuthor()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__INFORMANT:
				return ((InternalEList<?>)getInformant()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PARTICIPANT:
				return ((InternalEList<?>)getParticipant()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ENTRY_RELATIONSHIP:
				return ((InternalEList<?>)getEntryRelationship()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REFERENCE:
				return ((InternalEList<?>)getReference()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PRECONDITION:
				return ((InternalEList<?>)getPrecondition()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REALM_CODE:
				return getRealmCode();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID:
				return getTypeId();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TEMPLATE_ID:
				return getTemplateId();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID:
				return getId();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE:
				return getLanguageCode();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE:
				return getValue();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT:
				return getSubject();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SPECIMEN:
				return getSpecimen();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PERFORMER:
				return getPerformer();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__AUTHOR:
				return getAuthor();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__INFORMANT:
				return getInformant();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PARTICIPANT:
				return getParticipant();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ENTRY_RELATIONSHIP:
				return getEntryRelationship();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REFERENCE:
				return getReference();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PRECONDITION:
				return getPrecondition();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__CLASS_CODE:
				return getClassCode();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID1:
				return getID1();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__MOOD_CODE:
				return getMoodCode();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__NULL_FLAVOR:
				return getNullFlavor();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REALM_CODE:
				getRealmCode().clear();
				getRealmCode().addAll((Collection<? extends CS1>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID:
				setTypeId((POCDMT000040InfrastructureRootTypeId)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TEMPLATE_ID:
				getTemplateId().clear();
				getTemplateId().addAll((Collection<? extends II>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID:
				getId().clear();
				getId().addAll((Collection<? extends II>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE:
				setLanguageCode((CS1)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE:
				setValue((ED)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT:
				setSubject((POCDMT000040Subject)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SPECIMEN:
				getSpecimen().clear();
				getSpecimen().addAll((Collection<? extends POCDMT000040Specimen>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PERFORMER:
				getPerformer().clear();
				getPerformer().addAll((Collection<? extends POCDMT000040Performer2>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__AUTHOR:
				getAuthor().clear();
				getAuthor().addAll((Collection<? extends POCDMT000040Author>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__INFORMANT:
				getInformant().clear();
				getInformant().addAll((Collection<? extends POCDMT000040Informant12>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PARTICIPANT:
				getParticipant().clear();
				getParticipant().addAll((Collection<? extends POCDMT000040Participant2>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ENTRY_RELATIONSHIP:
				getEntryRelationship().clear();
				getEntryRelationship().addAll((Collection<? extends POCDMT000040EntryRelationship>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REFERENCE:
				getReference().clear();
				getReference().addAll((Collection<? extends POCDMT000040Reference>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PRECONDITION:
				getPrecondition().clear();
				getPrecondition().addAll((Collection<? extends POCDMT000040Precondition>)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__CLASS_CODE:
				setClassCode((Enumerator)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID1:
				setID1((String)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__MOOD_CODE:
				setMoodCode((Enumerator)newValue);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__NULL_FLAVOR:
				setNullFlavor((Enumerator)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REALM_CODE:
				getRealmCode().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID:
				setTypeId((POCDMT000040InfrastructureRootTypeId)null);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TEMPLATE_ID:
				getTemplateId().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID:
				getId().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE:
				setLanguageCode((CS1)null);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE:
				setValue((ED)null);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT:
				setSubject((POCDMT000040Subject)null);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SPECIMEN:
				getSpecimen().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PERFORMER:
				getPerformer().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__AUTHOR:
				getAuthor().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__INFORMANT:
				getInformant().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PARTICIPANT:
				getParticipant().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ENTRY_RELATIONSHIP:
				getEntryRelationship().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REFERENCE:
				getReference().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PRECONDITION:
				getPrecondition().clear();
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__CLASS_CODE:
				setClassCode(CLASS_CODE_EDEFAULT);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID1:
				setID1(ID1_EDEFAULT);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__MOOD_CODE:
				setMoodCode(MOOD_CODE_EDEFAULT);
				return;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__NULL_FLAVOR:
				setNullFlavor(NULL_FLAVOR_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REALM_CODE:
				return realmCode != null && !realmCode.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TYPE_ID:
				return typeId != null;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__TEMPLATE_ID:
				return templateId != null && !templateId.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID:
				return id != null && !id.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__LANGUAGE_CODE:
				return languageCode != null;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__VALUE:
				return value != null;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SUBJECT:
				return subject != null;
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__SPECIMEN:
				return specimen != null && !specimen.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PERFORMER:
				return performer != null && !performer.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__AUTHOR:
				return author != null && !author.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__INFORMANT:
				return informant != null && !informant.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PARTICIPANT:
				return participant != null && !participant.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ENTRY_RELATIONSHIP:
				return entryRelationship != null && !entryRelationship.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__REFERENCE:
				return reference != null && !reference.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__PRECONDITION:
				return precondition != null && !precondition.isEmpty();
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__CLASS_CODE:
				return CLASS_CODE_EDEFAULT == null ? classCode != null : !CLASS_CODE_EDEFAULT.equals(classCode);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__ID1:
				return ID1_EDEFAULT == null ? iD1 != null : !ID1_EDEFAULT.equals(iD1);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__MOOD_CODE:
				return MOOD_CODE_EDEFAULT == null ? moodCode != null : !MOOD_CODE_EDEFAULT.equals(moodCode);
			case V3Package.POCDMT000040_OBSERVATION_MEDIA__NULL_FLAVOR:
				return NULL_FLAVOR_EDEFAULT == null ? nullFlavor != null : !NULL_FLAVOR_EDEFAULT.equals(nullFlavor);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (classCode: ");
		result.append(classCode);
		result.append(", iD1: ");
		result.append(iD1);
		result.append(", moodCode: ");
		result.append(moodCode);
		result.append(", nullFlavor: ");
		result.append(nullFlavor);
		result.append(')');
		return result.toString();
	}

} //POCDMT000040ObservationMediaImpl
